      --Utils
      lfs     = require 'lfs'
      inspect = require 'scripts.utils.inspect'
      logger = require 'scripts.utils.logger'
      Vector = require 'scripts.utils.Vector'
      DisplayObjectUtils = require 'scripts.utils.DisplayObjectUtils'
      GeometricUtils = require 'scripts.utils.GeometricUtils'
      LuaUtils = require 'scripts.utils.LuaUtils'
      Sound = require 'scripts.utils.Sound'
      CBE = require 'CBEffects.Library'

      --Globals
      X,Y = display.viewableContentWidth,display.viewableContentHeight
      halfX, halfY = X * 0.5, Y * 0.5
      require 'scripts.GameConstants'--Include several global variables
      GameController = require 'scripts.controllers.GameController'
      GameWorld = require 'scripts.models.GameWorld'
         --Game Screen Models
         Circle = require 'scripts.models.Circle'
         Player = require 'scripts.models.Player'
         Grid = require 'scripts.models.Grid'

--Cleaning logs
logger:clean()
logger:gameEvent('%s - %dx%d',system.getInfo("environment"),X,Y)

system.setIdleTimer(false) -- disable device sleep mode

function startLevel()
   local storyboard = require "storyboard"
   storyboard.gotoScene("scripts.scenes.testScene",{effect = "fade",time = 100})
   --storyboard.gotoScene("scripts.scenes.testingEffectsScene",{effect = "fade",time = 100})

	--storyboard.gotoScene("scripts.scenes.gridTestScene",{effect = "fade",time = 100})
end

local function myUnhandledErrorListener( event )
   local errorMessage = event.errorMessage .. event.stackTrace
   logger:debug(errorMessage)

   local errorBg = display.newRect(X*0.5,Y*0.5,X,Y)
   errorBg:setFillColor(1,1,1,0.5)
   local errorText = display.newText({
      text   = errorMessage,
      x      = X*0.51,
      y      = Y*0.51,
      align  = 'left',
      width  = X,
      height = Y,
      font   = native.systemFontBold,
      fontSize = 10
      })
   errorText:setTextColor(0,0,0,1)
   return false
end
Runtime:addEventListener("unhandledError", myUnhandledErrorListener)

local fps = require("scripts.utils.fps")
      local performance = fps.PerformanceOutput.new();
      performance.group.x, performance.group.y = X-20,Y-10
      performance.group.alpha = 0.8; -- So it doesn't get in the way of the rest of the scene

startLevel()


--http://www.freesound.org/search/?q=game+music&f=&s=num_downloads+desc&advanced=0&g=1